# Author: petter.strandmark@gmail.com (Petter Strandmark)

MACRO (SPII_EXAMPLE NAME)
	ADD_EXECUTABLE(${NAME}${EXECUTABLE_EXTENSION}
	               ${NAME}.cpp
	               ${SPII_HEADERS})
	TARGET_LINK_LIBRARIES(${NAME}${EXECUTABLE_EXTENSION} spii)
	SET_PROPERTY(TARGET ${NAME}${EXECUTABLE_EXTENSION}         PROPERTY FOLDER "Examples")
ENDMACRO (SPII_EXAMPLE)

FILE(GLOB EXAMPLE_FILES *.cpp)
FOREACH (EXAMPLE_FILE ${EXAMPLE_FILES})
	GET_FILENAME_COMPONENT(EXAMPLE_NAME ${EXAMPLE_FILE} NAME_WE)
	MESSAGE("-- Adding example: " ${EXAMPLE_NAME})
	SPII_EXAMPLE(${EXAMPLE_NAME})
ENDFOREACH()
